using System;
using System.Text;
using System.Collections.Generic;
using iBeauty.BusinessObjects;
using iBeauty.DAL;

namespace iBeauty.BLL
{
	public class ShopBLL
	{
		private ShopDAO _ShopDAO;

		public ShopDAO ShopDAO
		{
			get { return _ShopDAO; }
			set { _ShopDAO = value; }
		}

		public ShopBLL()
		{
			ShopDAO = new ShopDAO();
		}
		public List<Shop> GetShops()
		{
			try
			{
				return ShopDAO.GetShops();
			}
			catch(Exception ex)
			{
				throw ex;
			}
		}
		public Shop GetShop(string ID)
		{
			try
			{
				return ShopDAO.GetShop(ID);
			}
			catch(Exception ex)
			{
				throw ex;
			}
		}
		public int AddShop(Shop oShop)
		{
			try
			{
				return ShopDAO.AddShop(oShop);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int AddShop(string ID,DateTime? CreateDate,DateTime? ModifiedDate,DateTime? TimeStamp,string ShopCode,string ShopName,int? ShopType,string Address,string Email,string Phone,string Fax,DateTime? OpenTime,DateTime? CloseTime,int? AccountId,string Note)
		{
			try
			{
				return ShopDAO.AddShop(ID,CreateDate,ModifiedDate,TimeStamp,ShopCode,ShopName,ShopType,Address,Email,Phone,Fax,OpenTime,CloseTime,AccountId,Note);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int UpdateShop(Shop oShop)
		{
			try
			{
				return ShopDAO.UpdateShop(oShop);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int UpdateShop(string ID,DateTime? CreateDate,DateTime? ModifiedDate,DateTime? TimeStamp,string ShopCode,string ShopName,int? ShopType,string Address,string Email,string Phone,string Fax,DateTime? OpenTime,DateTime? CloseTime,int? AccountId,string Note)
		{
			try
			{
				return ShopDAO.UpdateShop(ID,CreateDate,ModifiedDate,TimeStamp,ShopCode,ShopName,ShopType,Address,Email,Phone,Fax,OpenTime,CloseTime,AccountId,Note);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int RemoveShop(Shop oShop)
		{
			try
			{
				return ShopDAO.RemoveShop(oShop);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int RemoveShop(string ID)
		{
			try
			{
				return ShopDAO.RemoveShop(ID);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public List<Shop> DeserializeShops(string Path)
		{
			try
			{
				return GenericXmlSerializer<List<Shop>>.Deserialize(Path);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public void SerializeShops(string Path, List<Shop> Shops)
		{
			try
			{
				GenericXmlSerializer<List<Shop>>.Serialize(Shops, Path);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
	}
}
